import * as config from '@/common/config.js';
export const getSysTime = (params,url,guidId='') => {
	return new Promise((resolve, reject) => {
		uni.request({
			method: 'get',
			url: `${config.CONFIGBASEURL().sysUrl}/system/com/getSysTime?pattern=${params}`,
			data: JSON.stringify(params),
			header:{
				'api-link':url?url:'',
				'sys-time':Date.now()+'@'+guidId
			},
			success: (res) => {
				if(res.statusCode==502){
					console.log( Number(res.statusCode))
					uni.reLaunch({
						url:'/pages/badPage'
					})
				}
				if (res.data.code == 200) {
					resolve(res.data.data); //返回值
				} else {
					resolve(null); //返回值
				}
			}
		})


	});
};